import request from '@/utils/request'

// ----------------------------------------------------维修工单 接口文档----------------------------------------------------------------------------

// 获取维修工单列表---------------------------------------- 
export function list (params) {
  return request({
    url: '/function/repair/list',
    method: 'get',
    params
  })
}

// 获取维修工单列表详情---------------------------------------- 
export function listDetail (id) {
  return request({
    url: '/function/repair/' + id,
    method: 'get',
  })
}

//新增： 获取设备部门列表----------------------------------------
export function listDept (params) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params
  })
}

//新增： 获取设备列表----------------------------------------
export function listEquipmentAccount (params) {
  return request({
    url: '/function/equipment/account/partInfo/list',
    method: 'get',
    params
  })
}
//编辑： 获取设备列表----------------------------------------
export function listEquipmentAccounts (id) {
  return request({
    url: '/function/equipment/account/partInfo/list?params%5BuserStatuses%5D=0,1,2,4&params%5BdeptIds%5D=' + id,
    method: 'get',
  })
}

//新增： 获取故障维修字典列表----------------------------------------
export function listDictionary (params) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params
  })
}

//新增： 提交接口----------------------------------------
export function add (data) {
  return request({
    url: '/function/repair',
    method: 'post',
    data
  })
}

// 分派：维修员与协同维修员列表接口---------------------------------------
export function listuser (params) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params
  })
}

// 分派：提交接口---------------------------------------
export function assignPut (data) {
  return request({
    url: '/function/repair/assign',
    method: 'put',
    data
  })
}

// 编辑：列表的编辑提交接口---------------------------------------
export function updateCreate (data) {
  return request({
    url: '/function/repair',
    method: 'put',
    data
  })
}

// ----------------------------------------------------我的维修 接口文档----------------------------------------------------------------------------
// 获取我的维修单列表---------------------------------------- 
export function listRight (params) {
  return request({
    url: '/function/repair/my/list',
    method: 'get',
    params
  })
}

// 处理完毕：换下备件列表---------------------------------------- 
export function listreplaceRecord (params) {
  return request({
    url: '/function/equipment/consumable/replaceRecord/list',
    method: 'get',
    params
  })
}

// 处理完毕：提交接口---------------------------------------- 
export function updateCreateRight (data) {
  return request({
    url: '/function/repair/resolved',
    method: 'put',
    data
  })
}

// 转委外单：获取委外服务商信息
export function supplierlist (params) {
  return request({
    url: '/function/supplier/list',
    method: 'get',
    params
  })
}

// 转委外单：获取审核人与抄送人信息
export function getuserlist (params) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params
  })
}

// 转委外单：提交接口---------------------------------------- 
export function updateOutsourceRight (data) {
  return request({
    url: '/function/repair/turn/outsource',
    method: 'put',
    data
  })
}

// 开始维修：提交接口---------------------------------------- 
export function updateStartRight (data) {
  return request({
    url: '/function/repair/start',
    method: 'put',
    data
  })
}